<%-- 
    Document   : EnterMarksAction
    Created on : Nov 17, 2013, 5:18:58 PM
    Author     : smarzoug
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
		<br>
		<%
			String target = "EnterMarks.jsp?status=failed";
				try{
				 Profile  rb=new Profile();
				 String hno = request.getParameter("hno");
		         rb.setHno(hno);
		         rb.setSub1(request.getParameter("sub1"));
		         rb.setSub2(request.getParameter("sub2"));
		         rb.setSub3(request.getParameter("sub3"));
		         int role=new EnterMarksDAO().enterMarks(rb);
		         role=1;
		         if(role==1)
		         { 
		            target = "EnterMarks.jsp?status=inserted with this "+hno;
		            /*session.setAttribute("hno",hno);
		            session.setAttribute("role",role);*/
		         } 
		        
		            else
		                target = "EnterMarks.jsp?status=Invalid hno";    	
		            /*session.setAttribute("hno",hno);*/
		           
		         
		            }catch(Exception e){} 
		        response.sendRedirect(target);
		%>
	</body>
</html>
